package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CashMapper;
import com.ruoyi.system.domain.Cash;
import com.ruoyi.system.service.ICashService;
import com.ruoyi.common.core.text.Convert;

/**
 * 积分提现Service业务层处理
 * 
 * @author ruoyi
 * @date 2019-11-07
 */
@Service
public class CashServiceImpl implements ICashService 
{
    @Autowired
    private CashMapper cashMapper;

    /**
     * 查询积分提现
     * 
     * @param id 积分提现ID
     * @return 积分提现
     */
    @Override
    public Cash selectCashById(Long id)
    {
        return cashMapper.selectCashById(id);
    }

    /**
     * 查询积分提现列表
     * 
     * @param cash 积分提现
     * @return 积分提现
     */
    @Override
    public List<Cash> selectCashList(Cash cash)
    {
        return cashMapper.selectCashList(cash);
    }

    /**
     * 新增积分提现
     * 
     * @param cash 积分提现
     * @return 结果
     */
    @Override
    public int insertCash(Cash cash)
    {
        cash.setCreateTime(DateUtils.getNowDate());
        return cashMapper.insertCash(cash);
    }

    /**
     * 修改积分提现
     * 
     * @param cash 积分提现
     * @return 结果
     */
    @Override
    public int updateCash(Cash cash)
    {
        cash.setUpdateTime(DateUtils.getNowDate());
        return cashMapper.updateCash(cash);
    }

    /**
     * 删除积分提现对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCashByIds(String ids)
    {
        return cashMapper.deleteCashByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除积分提现信息
     * 
     * @param id 积分提现ID
     * @return 结果
     */
    @Override
    public int deleteCashById(Long id)
    {
        return cashMapper.deleteCashById(id);
    }
}
